home *** CD-ROM | disk | FTP | other *** search
/ QRZ! Ham Radio 8 / QRZ Ham Radio Callsign Database - Volume 8.iso / pc / files / dsp / 96000tar.z / 96000tar / 96000 / appb / b117.asm < prev    next >
Assembly Source File  |  1992-04-28  |  3KB  |  82 lines

  1. ; This program was originally published in the Motorola DSP96002 Users Manual
  2. ; and is provided under a DISCLAIMER OF WARRANTY available from Motorola DSP
  3. ; Operation, 6501 William Cannon Drive West, Austin, Texas 78735-8598.  For
  4. ; more information, refer to the DSP96002 Users Manual, Appendix B, DSP
  5. ; Benchmarks.
  6. ;
  7. ; B.1.17    FIR Lattice Filter  
  8. ;N refers to the number of 'k' coefficients in the lattice filter.  Some  filters may have other coeffi-
  9. ;cients other than the 'k' coefficients but  their number may be determined from k.  
  10. ;                                          FIR LATTICE FILTER 
  11. ;       
  12. ;     COEFFICIENT AND STATE VARIABLE STORAGE 
  13. ;       R0                 R4 
  14. ;                            
  15. ;                          
  16. ;   x:  S1 S2 S3 Sx     y: k1 k2 k3 
  17. ;        M0=3 (mod 4)       M4=2 (mod 3) 
  18. ;                                  SINGLE SECTION 
  19. ;                
  20. ;                    t                t'     equations: 
  21. ;                                            t'=s*k+t, t'?t 
  22. ;                           k                 s'=t*k+s 
  23. ;                         
  24. ;                        
  25. ;                       
  26. ;                      
  27. ;                     
  28. ;                             k
  29. ;                            
  30. ;               
  31. ;                   s             s' 
  32. ;                                            DSP56000 IMPLEMENTATION 
  33. ;                                                              Program        ICycles
  34. ;                                                              Words 
  35. ; move      #state,r0     ;point to state variable storage 
  36. ; move      #N,m0         ;N=number of k coefficients 
  37. ; move      #k,r4         ;point to k coefficients 
  38. ; move      #N-1,m4       ;mod for k's 
  39. ; movep     y:datin,b     ;get input 
  40. ; move      b,x:(r0)+  y:(r4)+,y0  ;save 1st state, get k    1       1 
  41. ; do        #N,_elat               ;do each section          2       3 
  42. ; move          x:(r0),a   b,y1    ;get s, copy t for mul    1       1 
  43. ; macr y1,y0,a             a,y0    ;t*k+s, copy s            1       1 
  44. ; macr x0,y0,b  a,x:(r0)+  y:(r4)+,y0 ;s*k+t, sv st, nxt k   1       1 
  45. ;_elat 
  46. ; move       x:(r0)-,x0 y:(r4)-,y0 ;adj r0,r4 w/dummy loads  1       1 
  47. ; movep      b,y:datout    ;output sample                  -----   ----- 
  48. ;                                                   Totals:  7      3N+5 
  49. ;                                            DSP96002 IMPLEMENTATION 
  50. ;                                                            Program    ICyc
  51. ;                                                            Words 
  52.  move     #state,r0     ;point to state variable storage 
  53.  move     #N,m0         ;N=number of k coefficients 
  54.  move     #k,r4         ;point to k coefficients 
  55.  move     #N-1,m4       ;mod for k's 
  56.  
  57.  move      y:datin,d5.s  ;get input 
  58.  
  59.  move                      d5.s,x:(r0)+ y:(r4)+,d4.s ;sv s,get k  1    1 
  60.  do        #N,_elat                                  ;do filter   2    3 
  61.  fmpy d5,d4,d3             x:(r0),d0.s               ;t*k, get s  1    1 
  62.  fmpy d0,d4,d1 fadd.s d3,d0                          ;s*k,t*k+s   1    1 
  63.                fadd.s d1,d5 d0.s,x:(r0)+ y:(r4)+,d4.s ;s*k+t; s,k 1    1 
  64. _elat 
  65.  move         x:(r0)-,d0.s y:(r4)-,d7.s ;adj r0,r4 w/dummy loads  1    1 
  66.  
  67.  movep        d5,y:datout            ;output sample 
  68. ;                                                                ---  --- 
  69. ;                                                        Totals:  7  3N+5 
  70.